/*
Copyright (C) BABEC. All rights reserved.
Copyright (C) THL A29 Limited, a Tencent company. All rights reserved.

SPDX-License-Identifier: Apache-2.0
*/

package pkcs11

import "github.com/miekg/pkcs11"

const (
	CKK_VENDOR_DEFINED = pkcs11.CKK_VENDOR_DEFINED
	CKM_VENDOR_DEFINED = pkcs11.CKM_VENDOR_DEFINED
)

const (
	CKK_SM2 = (CKK_VENDOR_DEFINED + 4)
	CKK_SM3 = (CKK_VENDOR_DEFINED + 5)

	CKM_SM2                = (CKM_VENDOR_DEFINED + 0x8000)
	CKM_SM2_KEY_PAIR_GEN   = (CKM_SM2 + 0x00000001)
	CKM_SM3_SM2            = (CKM_SM2 + 0x00000100)
	CKM_SM3_SM2_DER        = (CKM_SM2 + 0x00000101)
	CKM_SM3_SM2_APPID1     = (CKM_SM2 + 0x00000102)
	CKM_SM3_SM2_APPID1_DER = (CKM_SM2 + 0x00000103)
	CKM_SM3_SM2_Z          = CKM_SM3_SM2_APPID1
	CKM_SM3_SM2_Z_DER      = CKM_SM3_SM2_APPID1_DER
	CKM_SM2_SIGN           = (CKM_SM2 + 0x00000104)
	CKM_SM2_SIGN_NO_DER    = (CKM_SM2 + 0x00000105)

	CKM_SM2_RAW         = (CKM_SM2 + 0x00000200)
	CKM_SM2_CIPHER_DER  = (CKM_SM2 + 0x00000201)
	CKM_SM2_RAW_DER     = CKM_SM2_CIPHER_DER
	CKM_SHA_160_SM2     = (CKM_SM2 + 0x00000300)
	CKM_SM2_SHA_160     = CKM_SHA_160_SM2
	CKM_SHA_160_SM2_DER = (CKM_SM2 + 0x00000301)
	CKM_SM2_SHA1        = CKM_SHA_160_SM2
	CKM_SM2_SHA1_DER    = CKM_SHA_160_SM2_DER
	CKM_SHA_256_SM2     = (CKM_SM2 + 0x00000400)
	CKM_SM2_SHA_256     = CKM_SHA_256_SM2
	CKM_SHA_256_SM2_DER = (CKM_SM2 + 0x00000401)

	CKM_SM3          = (CKM_VENDOR_DEFINED + 0x9000)
	CKM_SM3_HASH     = (CKM_SM3 + 0x00000001)
	CKM_SM3_HASH_JIT = (CKK_VENDOR_DEFINED + 5)

	CKM_SM4_KEY_GEN = (CKM_VENDOR_DEFINED + 0x00000107)
	CKM_SM4_ECB     = (CKM_VENDOR_DEFINED + 0x00000108)
	CKM_SM4_CBC     = (CKM_VENDOR_DEFINED + 0x00000109)
	CKM_SM4_CTR     = (CKM_VENDOR_DEFINED + 0x0000010A)
	CKM_SM4_XTS     = (CKM_VENDOR_DEFINED + 0x0000010B)
	CKM_AES_XTS     = (CKM_VENDOR_DEFINED + 0x0000010C)
	CKM_SM4         = (CKM_VENDOR_DEFINED + 0xA000)
	CKM_SM4_ECB_PAD = (CKM_SM4 + 0x0101)
	CKM_SM4_CBC_PAD = (CKM_SM4 + 0x0201)
)
